//
//  Auction_SpecialSaleBusinessInfo_Cell_WX.m
//  ZITHER
//
//  Created by weixin on 2019/6/4.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Auction_SpecialSaleBusinessInfo_Cell_WX.h"

@implementation Auction_SpecialSaleBusinessInfo_Cell_WX

- (void)awakeFromNib {
    
    [super awakeFromNib];
    self.backgroundColor = HexColor(0xf5f5f5);
    // Initialization code
    
    [self.scrollview addScrImage:@[@"",@"",@"",@"",@"",@"",@"",@"",@""] imageHeight:100];

    [self setUI];
    
}

-(void)setUI{
    
    [self.MapImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(0);
        make.left.right.equalTo(self).offset(0);
        make.height.mas_equalTo(kScreenW/375.0*184);
    }];
    
    [self.merchantImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.MapImage.mas_bottom).offset(-40);
        make.left.equalTo(self).offset(15);
        make.height.width.mas_equalTo(80);
    }];
    
    [self.merchantName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.MapImage.mas_bottom).offset(15);
        make.left.equalTo(self.merchantImage.mas_right).offset(15);
        make.height.mas_equalTo(21);
    }];
    
    [self.Cardenter mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.MapImage.mas_bottom).offset(-20);
        make.right.equalTo(self).offset(-15);
        make.height.width.mas_equalTo(40);
    }];
        
    [self.BusinessInfoAptitude mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.right.equalTo(self).offset(-15);
        make.top.equalTo(self.merchantImage.mas_bottom).offset(15);
        make.height.mas_equalTo(46);
    }];
    
    [self.BusinessInfoLoaction mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.right.equalTo(self).offset(-15);
        make.top.equalTo(self.BusinessInfoAptitude.mas_bottom).offset(10);
        make.height.mas_equalTo(84);
    }];
    
    [self.scrollview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.right.equalTo(self).offset(0);
        make.top.equalTo(self.BusinessInfoLoaction.mas_bottom).offset(10);
        make.height.mas_equalTo(100);
        make.bottom.equalTo(self).offset(0);
    }];
}

-(BaseImageV *)MapImage{
    if (!_MapImage) {
        _MapImage = [[BaseImageV alloc]initializeFrame:CGRectZero contentMode:2];
        _MapImage.backgroundColor = [UIColor redColor];
        [self addSubview:_MapImage];
    }
    return _MapImage;
}

-(BaseImageV *)Cardenter{
    if (!_Cardenter) {
        _Cardenter = [[BaseImageV alloc]initializeFrame:CGRectZero contentMode:2];
        _Cardenter.backgroundColor = [UIColor yellowColor];
        [self addSubview:_Cardenter];

    }
    return _Cardenter;
}

-(BaseImageV *)merchantImage{
    if (!_merchantImage) {
        _merchantImage = [[BaseImageV alloc]initializeFrame:CGRectZero contentMode:2];
        [self addSubview:_merchantImage];
        [_merchantImage setCornerRadiusWithRadius:40 isMasks:YES];
        _merchantImage.backgroundColor = [UIColor grayColor];
        //sku_btn_position
    }
    return _merchantImage;
}

- (BaseLab *)merchantName{
        if (!_merchantName) {
            _merchantName = [BaseLab initCustomLab:@"商家名称" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFangSC-Semibold" size:20]];
            _merchantName.backgroundColor = [UIColor clearColor];
            [self addSubview:_merchantName];
        }
        return _merchantName;
}


-(BaseScrollView *)scrollview{
    if (!_scrollview) {
        _scrollview = [[BaseScrollView alloc]init];
        _scrollview.backgroundColor = HexColor(0xeeeeee);
        _scrollview.bounces = NO;
        _scrollview.showsHorizontalScrollIndicator = NO;
        _scrollview.showsVerticalScrollIndicator = NO;
        _scrollview.bounces = NO; // 默认为YES 取消设置NO
        // 当bounces属性为NO时，以下两个属性设置无效
        _scrollview.alwaysBounceHorizontal = YES; // 水平方向弹簧效果
        _scrollview.alwaysBounceVertical = YES; // 垂直方向弹簧效果
        _scrollview.decelerationRate = 0.1; // 值域 0~1 值越小减速停止的时间越短
        _scrollview.pagingEnabled = YES;
        [self addSubview:_scrollview];
    }
    return _scrollview;
}

-(Auction_SpecialSaleBusinessInfoAptitude_View_WX *)BusinessInfoAptitude{
    if (!_BusinessInfoAptitude) {
        _BusinessInfoAptitude = [[Auction_SpecialSaleBusinessInfoAptitude_View_WX alloc]init];
        [self addSubview:_BusinessInfoAptitude];
    }
    return _BusinessInfoAptitude;
}

-(Auction_SpecialSaleBusinessInfoLoaction_View_WX *)BusinessInfoLoaction{
    if (!_BusinessInfoLoaction) {
        _BusinessInfoLoaction = [[Auction_SpecialSaleBusinessInfoLoaction_View_WX alloc]init];
        [self addSubview:_BusinessInfoLoaction];
    }
    return _BusinessInfoLoaction;
}

@end
